<template>
  <div class="header">
    <!-- logo -->
    <div class="logo-box">
      <router-link to="/">
        <img src="~assets/logo.png" height="60" style="margin-left: 40px;margin-top: 5px">
      </router-link>
    </div>

    <!-- 导航栏模块 -->
    <m-nav v-if="header.data" :list="header.data" />

    <!-- 登录模块 -->
    <login-area />
  </div>
</template>
<script>
import MNav from './header-nav.vue'
import LoginArea from './header-login.vue'
export default {
  data () {
    return {
      //头部数据
      header: {
        data:[
          {
            "title": "免费课程",
            "path": "/free-course",
            "icon": ""
          },
          {
            "title": "实战课程",
            "path": "/course",
            "icon": ""
          },
          {
            "title": "问答中心",
            "path": "/question",
            "icon": ""
          }
        ]
      }
    }
  },
  mounted () {

  },
  methods: {

  },
  components: {
    MNav,
    LoginArea
  }
}
</script>

<style lang="stylus" scoped>
  @import '~assets/stylus/variables.styl';
  .header
    z-index: 99;
    position: relative;
    padding-right: 10px;
    height: 100%;
    background-color: #fff;
    box-shadow: 0 4px 8px $shadow;
    .logo-box
      float: left;
      width: 140px;
      margin: 0 20px;
      height: 100%;
</style>
